package day07;

import java.util.Scanner;
import static day07.Guessing.*;

public class PrimeNumber {
    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//        int num = scanner.nextInt();
        int num = getRandem(100,2);
        for (int i = 2; i < 100; i++) {
            onlyprime(i);

        }

    }
    //判断素数
    private static void prime(int num){
        boolean flag = true;
        for (int i = 2; i <= num/2; i++) {
            if (num%i==0){
                flag = false;
                break;
            }

        }
        if (flag){
            System.out.println(num+"是素数");
        }else {
            System.out.println(num+"不是素数");
        }
    }
    //只判断素数
    private static void onlyprime(int num){
        boolean flag = true;
        for (int i = 2; i <= num/2; i++) {
            if (num%i==0){
                flag = false;
                break;
            }
        }
        if (flag){
            System.out.print(num+"\t");
        }
    }
}
